﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Web.Master" AutoEventWireup="true" CodeBehind="GestionInsumos.aspx.cs" Inherits="SalaDeEnsayo.WebApplication.GestionInsumos" %>

<%@ MasterType VirtualPath="~/Web.Master" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <style type="text/css">

        
        .style5
        {
            width: 155px;
        }
        .style6
        {
            width: 199px;
        }
        .style7
        {
            width: 104px;
        }
        .style8
        {
            width: 4px;
        }
        </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolderMaster" runat="server">
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>
            <asp:Panel ID="pnlAgregar" runat="server" GroupingText="Agregar">
             <table>
                <tr>
                    <td class="style6">
                    
                             <div align="left">
                                <table class="nuevodetalle">
                                    <tr>
                                            <td class="style7">
                                                <asp:Label ID="lblFecha" runat="server" Text="Fecha: "></asp:Label>
                                                
                                            </td>
                                            <td class="style5">
                                                <asp:Label ID="lblDate" runat="server" Text=""></asp:Label>
                                            </td>
                                            
                                    </tr>
                                    <tr>
                                   
                                        <td class="style7">
                                             Producto<label for="Estilo">:</label>
                                        </td>
                                        <td class="style5">
                                             <asp:DropDownList ID="ddlProductos" runat="server" DataTextField="descripcion" 
                                                 DataValueField="id_producto" 
                                                 onselectedindexchanged="ddlProductos_SelectedIndexChanged"  
                                                 OnTextChanged="ddlProductos_SelectedIndexChanged" 
                                                 AutoPostBack="True">
                                             </asp:DropDownList>
                                        </td>
                                        <td class="style8">
                                            <asp:Label ID="lblProd" runat="server" ForeColor="Red" Text="*"></asp:Label>
                                        </td>
                       
                                    </tr>
                                    <tr>
                                        <td class="style7" >
                                            <label for="precio">Precio de Venta:</label>
                                        </td>
                                        <td class="style5">
                                            <asp:TextBox ID="txtPrecio" runat="server" Enabled="False"></asp:TextBox>
                                       </td>
                                       <td class="style8">
                                        </td>

                                    </tr>  
                                     <tr>
                                        <td class="style7" >
                                            <label for="precio">Stock:</label>
                                        </td>
                                        <td class="style5">
                                            <asp:TextBox ID="txtStock" runat="server" Enabled="False"></asp:TextBox>
                                       </td>
                                       <td class="style8">
                                        </td>

                                    </tr>   
                                      
                                    <tr>
                                        <td class="style7">
                                            <label for="Cantidad">Cantidad:</label>
                                        </td>
                                        <td class="style5">
                                            <asp:TextBox ID="txtCant" runat="server" ontextchanged="txtCant_TextChanged" MaxLength="3"></asp:TextBox>
                                           
                                       </td>
                                       <td class="style8">
                                           
                                           <asp:Label ID="lblCant" runat="server" ForeColor="Red" Text="*"></asp:Label>
                                           
                                       </td>
                                       

                                    </tr>   
                                    <tr>
                                    
                                        <td class="style7">
                                        </td>
                                        <td class="style5" >
                                        
                                         <asp:CompareValidator ID="CompareValidator1" runat="server" 
                                                ControlToCompare="txtStock" ControlToValidate="txtCant" 
                                                ErrorMessage="Cantidad incorrecta" Operator="LessThanEqual" 
                                                SetFocusOnError="True" Type="Integer"></asp:CompareValidator>
                                        </td>
                                    
                                    
                                    </tr>

                                </table>
                                
                            </div>
             
                    </td>
                    <td>
                    
                        <div align="right" dir="ltr">
                
                          <asp:GridView ID="grdProductos" runat="server" AlternatingRowStyle-CssClass="alt" 
                                 AutoGenerateColumns="False" CellPadding="3" CssClass="mGrid" 
                                 HeaderStyle-ForeColor="White"  HeaderStyle-HorizontalAlign="Center" 
                                 onpageindexchanging="grdProducto_PageIndexChanging" 
                                 onselectedindexchanged="grdProductos_SelectedIndexChanged1" 
                                 PagerStyle-CssClass="pgr" RowStyle-VerticalAlign="Top" Width="700px" 
                                AllowPaging="True" CaptionAlign="Top" PageSize="5" EmptyDataRowStyle-VerticalAlign="Top" EditRowStyle-VerticalAlign="Top" HeaderStyle-VerticalAlign="Top">
                                 <RowStyle VerticalAlign="Top" />
                                 <Columns>
                                     <asp:BoundField DataField="Nro" HeaderText="Nro" />
                                     <asp:BoundField DataField="Producto" HeaderText="Producto" />
                                     <asp:BoundField DataField="Precio" HeaderText="Precio" />
                                     <asp:BoundField DataField="Cantidad" HeaderText="Cantidad" />
                                     <asp:BoundField DataField="Total" HeaderText="Total" />
                                     
                                     <asp:TemplateField ItemStyle-Width="30px" Visible="true">
                                         <ItemTemplate>
                                             <asp:ImageButton ID="btnEliminar" runat="server" CausesValidation="false" 
                                                 CommandArgument='<%# Eval("Nro") %>' Height="15" 
                                                 ImageUrl="~/Images/prod_delete.jpg" OnClick="btnEliminar_Click" 
                                                 ToolTip="Eliminar" Width="15" />
                                         </ItemTemplate>
                                         <ItemStyle Width="30px" />
                                     </asp:TemplateField>
                                 </Columns>
                                 <PagerStyle CssClass="pgr" />
                                 <EmptyDataTemplate>
                                     No hay productos Cargados
                                 </EmptyDataTemplate>
                                 <HeaderStyle ForeColor="White" HorizontalAlign="Center" />
                                 <AlternatingRowStyle CssClass="alt" />
                             </asp:GridView>
                        </div>
             
                    </td>
             
                </tr>
                
                <tr>
                <td class="style6">
                    <div class="detalle3"  align="left">
                        <asp:Button ID="btnagregar" runat="server" Text="Agregar" Visible="true"
                            onclick="btnAgregar_Click" CausesValidation="true" />
                        <asp:Button ID="btnCancelar" runat="server" Text="Cancelar" 
                            onclick="btnCancelar_Click" CausesValidation="false"/>
                    </div>
                
                </td>
                
                <td>
                
                    <table>
                        <tr>
                            <td>
                                <div class="detalle3" dir="rtl">
                                    <asp:Button ID="btnBorrarTodo" runat="server" Text="Borrar Lista" Visible="true"
                                        onclick="btnBorrarTodo_Click" CausesValidation="false" />
                                    <asp:Button ID="btnGuardar" runat="server" Text="GuardarVenta" Visible="true"
                                        onclick="btnGuardar_Click" CausesValidation="false" />
                                </div>
                            </td>
                            <td>
                            
                            </td>
                            <td align="center">
                            
                                <div align="center">
                                    <asp:Label ID="lblTot" runat="server" Text="Total: $" ></asp:Label>
                                    <asp:Label ID="lblTotal" runat="server" Text="-"></asp:Label>
                                
                                </div>
                            
                               
                            </td>
                        
                        
                        </tr>
                    
                    </table>
                     
                     
                      
                
                
                </td>
                
                
                </tr>
             
             </table>
                
                
                
            </asp:Panel>
            
            <asp:Panel ID="pnlIncrementar" runat="server" GroupingText="Incrementar Stock">
                
                <table>
                    <tr>
                        <td>
                            <div>
                                <table class="detalle">
                                    <tr>
                                        <td>
                                             Producto<label for="Estilo">:</label>
                                       </td>
                                   
                                        <td>
                                             <asp:DropDownList ID="ddlProductos2" runat="server" DataTextField="descripcion" 
                                                 DataValueField="id_producto" 
                                                 onselectedindexchanged="ddlProductos_SelectedIndexChanged"  
                                                 OnTextChanged="ddlProductos2_SelectedIndexChanged" 
                                                 AutoPostBack="True">
                                             </asp:DropDownList>
                                        </td>
                                   
                                      
                                        <td>
                                            <asp:Label ID="lblProd2" runat="server" ForeColor="Red" Text="*"></asp:Label>
                                        </td>
                       
                                    </tr>                       
                                     <tr>
                                     
                                        <td>
                                            <label for="precio">Stock:</label>
                                        </td>
                                        <td >
                                            <asp:TextBox ID="txtStock2" runat="server" Enabled="False"></asp:TextBox>
                                        </td>
                                        
                                        <td>
                                        </td>

                                    </tr>   
                                   
                                     <tr>
                                        <td>
                                            <label for="Cantidad">Cantidad:</label>
                                        </td>
                                        <td>
                                            <asp:TextBox ID="txtCant2" runat="server" MaxLength="3"></asp:TextBox>

                                        </td>
                                         <td>
                                            <asp:Label ID="lblCant2" runat="server" ForeColor="Red" Text="*"></asp:Label>
                                        </td>
                                    
                                    </tr>   
                                </table>
                    
                            </div>
                        
                        
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <div class="detalle3" align="center">
                                <asp:Button ID="bntAgregarStock" runat="server" Text="Agregar" Visible="true"
                                    onclick="btnAgregarStock_Click" CausesValidation="true" />
                                <asp:Button ID="btnCancelar2" runat="server" Text="Cancelar" 
                                    onclick="btnCancelarInc_Click" CausesValidation="false"/>
               
                            </div>
                        
                        </td>
                    
                    </tr>
                </table>

              
            </asp:Panel>
        </ContentTemplate>
    </asp:UpdatePanel>
</asp:Content>
